﻿using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Web;

namespace Elektronix.Class
{
    public class menu
    {
         public int  menuID;
         public string menucontent;
         public string menulink;
         public string imgpath;


        


         public static List<menu> menulergetir()
         {
             List<menu> menu = new List<menu>();
             SqlConnection sqlcon = connection.baglanti;
             SqlCommand sqlcmd = new SqlCommand("select * from menubar",sqlcon);
             sqlcon.Open();
             SqlDataReader sdr = sqlcmd.ExecuteReader();
             while (sdr.Read())
             {
                 menu m = new menu();
                 m.menuID=Convert.ToInt32(sdr["ID"]);
                 m.menucontent = sdr["menucontent"].ToString();
                 m.menulink = sdr["menulink"].ToString();
                 m.imgpath = sdr["menuimg"].ToString();
                 menu.Add(m);
             }
             sqlcon.Close();
             return menu;
         }





    }
}